import { Redirect } from 'umi';
import { connect } from 'dva';
import { Component } from 'react';
import { render } from 'react-dom';
@connect(state => ({ user: state.user }))
export default class permission extends Component {
  render() {
    if (!this.props.user.token) {
      return <Redirect to="/login"></Redirect>;
    }
    return <div>{this.props.children}</div>;
  }
}
